/*
 * SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#![allow(unexpected_cfgs, clippy::module_inception)]
pub mod utconfig {
    // config.rs

    // Enable native language support (NLS)
    pub const ENABLE_NLS: bool = true;

    // Check if `alloca` is available (usually in C, but we don’t directly use it in Rust)
    pub const HAVE_ALLOCA: bool = true;

    // Check if we have `alloca.h` available
    pub const HAVE_ALLOCA_H: bool = true;

    // Check for the availability of GNU `dcgettext` function
    pub const HAVE_DCGETTEXT: bool = true;

    // Check for the availability of GNU `gettext` function
    pub const HAVE_GETTEXT: bool = true;

    // Check if we have `iconv` function (typically for character encoding conversion)
    // pub const HAVE_ICONV: bool = false; // Not supported in Rust directly (use `encoding_rs` crate or `iconv` crate if needed)

    // Check if we have the `<inttypes.h>` header file
    pub const HAVE_INTTYPES_H: bool = true;

    // Check if we have the `<memory.h>` header file (usually provides memory management functions)
    pub const HAVE_MEMORY_H: bool = true;

    // Check if we have the `<stdint.h>` header file (for fixed-width integer types)
    pub const HAVE_STDINT_H: bool = true;

    // Check if we have the `<stdlib.h>` header file (for functions like `malloc`, `free`, etc.)
    pub const HAVE_STDLIB_H: bool = true;

    // Check if we have the `<strings.h>` header file (typically provides string-related functions like `strcasecmp`)
    pub const HAVE_STRINGS_H: bool = true;

    // Check if we have the `<string.h>` header file (for general string manipulation functions)
    pub const HAVE_STRING_H: bool = true;

    // Check if we have the `<sys/stat.h>` header file (provides file status related functions)
    pub const HAVE_SYS_STAT_H: bool = true;

    // Check if we have the `<sys/types.h>` header file (for system types)
    pub const HAVE_SYS_TYPES_H: bool = true;

    // Check if we have the `<unistd.h>` header file (for Unix-like system calls like `getpid`, `fork`, etc.)
    pub const HAVE_UNISTD_H: bool = true;

    // Package information
    pub const PACKAGE_BUGREPORT: &str = "";
    pub const PACKAGE_NAME: &str = "passwd";
    pub const PACKAGE_STRING: &str = "passwd 0.80";
    pub const PACKAGE_TARNAME: &str = "passwd";
    pub const PACKAGE_URL: &str = "";
    pub const PACKAGE_VERSION: &str = "0.80";

    // Stack growth direction for systems that provide `alloca` (in C)
    // pub const STACK_DIRECTION: i32 = 0; // Direction unknown (we generally don’t use alloca in Rust)

    // Check if we have the ANSI C standard headers (this is a basic check)
    pub const STDC_HEADERS: bool = true;

    // Enable extensions on AIX 3, Interix.

    #[cfg(not(feature = "_ALL_SOURCE"))]
    pub const _ALL_SOURCE: bool = true; // Equivalent to `#define _ALL_SOURCE 1` in C

    // Enable GNU extensions on systems that have them.
    #[cfg(not(feature = "_GNU_SOURCE"))]
    pub const _GNU_SOURCE: bool = true; // Equivalent to `#define _GNU_SOURCE 1` in C

    // Enable threading extensions on Solaris.
    #[cfg(not(feature = "_POSIX_PTHREAD_SEMANTICS"))]
    pub const _POSIX_PTHREAD_SEMANTICS: bool = true; // Equivalent to `#define _POSIX_PTHREAD_SEMANTICS 1` in C

    // Enable extensions on HP NonStop.
    #[cfg(not(feature = "_TANDEM_SOURCE"))]
    pub const _TANDEM_SOURCE: bool = true; // Equivalent to `#define _TANDEM_SOURCE 1` in C

    // Enable general extensions on Solaris.
    #[cfg(not(feature = "__EXTENSIONS__"))]
    pub const __EXTENSIONS__: bool = true; // Equivalent to `#define __EXTENSIONS__ 1` in C

    // Check if we want to use Linux Audit (this is a configuration flag)
    pub const WITH_AUDIT: bool = true;

    // Check if we want to use SELinux (this is a configuration flag)
    pub const WITH_SELINUX: bool = true;

    // Check if we are running on MINIX (unused in this context)
    // pub const _MINIX: bool = false; // Equivalent to `#undef _MINIX` in C

    // Define if POSIX.1 features are provided
    // pub const _POSIX_1_SOURCE: bool = false; // Equivalent to `#undef _POSIX_1_SOURCE` in C

    // Define if we need certain system features for `stat` and other things to work
    // pub const _POSIX_SOURCE: bool = false; // Equivalent to `#undef _POSIX_SOURCE` in C

    // Define to `unsigned int` if <sys/types.h> does not define `size_t`
    // pub const SIZE_T_IS_UNSIGNED_INT: bool = false; // Equivalent to `#undef size_t` in C
}
